﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TrainingsApp.Logic;

namespace TrainingsApp.IPADApp.Master {
    public partial class SystemInfoSetting : PageBase {
        protected void Page_Load(object sender, EventArgs e) {




            //CKEditor1.config.uiColor = "#E0EDFF";
            CKEditor1.config.language = "zh-cn";
            CKEditor1.config.enterMode = CKEditor.NET.EnterMode.BR;

            this.CKEditor1.config.toolbar = new object[]
			{
					new object[] { "Source","NewPage","DocProps","Preview","-","Templates"  },

				new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript","RemoveFormat" },
					
                new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent" ,"-","Blockquote","CreateDiv"},
				new object[] { "TextColor", "BGColor" },"/",
                new object[] { "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" },
				
               new object[]  { "PasteText","PasteFromWord","-","Undo","Redo" },
				new object[] { "Styles", "Format", "Font", "FontSize" }
				
			};

            string addFont = ";\r\n黑体/'黑体';\r\n宋体/'宋体';\r\n微软雅黑/'微软雅黑';";
            this.CKEditor1.FontNames += addFont;
            if (!this.IsPostBack) {
                var entity = TS_SystemInfoSetting_Logic.View("SYSTEMACTION");
                if (entity != null) { this.CKEditor1.Text = entity.ConfigValue; }
            }
        }

        protected void btnSave_Click(object sender, EventArgs e) {
            var entity = TS_SystemInfoSetting_Logic.View("SYSTEMACTION");
            if (entity == null) {
                entity = new Model.TS_SystemInfo_Entity();

            }
            entity.ConfigValue = this.CKEditor1.Text;
            entity.ConfigName = "SYSTEMACTION";
            TS_SystemInfoSetting_Logic.Update(entity);
            MessageBox.Show("保存成功");
        }

    }
}